{% block body %}

<h1>District</h1>

<table class="record_properties">
    <tbody>
        <tr>
            <th>Name</th>
            <td>{{ entity.name }}</td>
        </tr>
        <tr>
            <th>Terrain</th>
            <td>{{ entity.terrain.name }}</td>
        </tr>
        <tr>
            <th>Population</th>
            <td>{{ entity.population|number_format }}</td>
        </tr>
        <tr>
            <th>Miejsce</th>
            <td>{{ entity.buildingsCount }}/{{ entity.capacity}}</td>
        </tr>
        <tr>
            <th>Coal</th>
            <td><span class="with-help" title="Godzinne wydobycie: {{ entity.coalProductionRatio|number_format }}">{{ entity.coal|number_format }}/{{entity.coalStorage.capacity|number_format}}</span></td>
        </tr>
        <tr>
            <th>Metal</th>
            <td><span class="with-help" title="Godzinne wydobycie: {{ entity.metalProductionRatio|number_format }}">{{ entity.metal|number_format }}/{{entity.metalStorage.capacity|number_format}}</span></td>
        </tr>
        <tr>
            <th>Oil</th>
            <td><span class="with-help" title="Godzinne wydobycie: {{ entity.oilProductionRatio|number_format }}">{{ entity.oil|number_format }}/{{entity.oilTank.capacity|number_format}}</span></td>
        </tr>
        <tr>
            <th>Energy</th>
            <td>{{ entity.energy|number_format }}</td>
        </tr>
        <tr>
            <th>Coalbonus</th>
            <td>{{ entity.coalBonus }}</td>
        </tr>
        <tr>
            <th>Metalbonus</th>
            <td>{{ entity.metalBonus }}</td>
        </tr>
        <tr>
            <th>Oilbonus</th>
            <td>{{ entity.oilBonus }}</td>
        </tr>
        <tr>
            <th>Energybonus</th>
            <td>{{ entity.energyBonus }}</td>
        </tr>        
        <tr>
            <th>Morale</th>
            <td>{{ entity.morale }}</td>
        </tr>
        <tr>
            <th>Created</th>
            <td>{{ entity.created|date('Y-m-d H:i:s') }}</td>
        </tr>
        <tr>
            <th>Updated</th>
            <td>{{ entity.updated|date('Y-m-d H:i:s') }}</td>
        </tr>
        <tr>
            <th>Id</th>
            <td>{{ entity.id }}</td>
        </tr>
    </tbody>
</table>

<div class="building_container">
    <div class="building"><span class="title">Kopalnia węgla</span>
        <div class="miniature" id="CoalMine"></div>
        <ul>
            <li>Poziom: {{entity.coalMine.level}}</li>
            <li>Kondycja: {{entity.coalMine.condition*100}}%</li>
            <li>Koszt budowy: {{entity.coalMine.getMetalCost}}/{{entity.coalMine.getCoalCost}}/{{entity.coalMine.getOilCost}}</li>
            <li>Czas budowy: {{entity.coalMine.getBuildingTime}}
            <ul>
                <li><a href="#building_queue" target-container="#building_queue" data-url="{{ path('district_build', { 'id': entity.id, 'buildingType': 'CoalMine' }) }}">Buduj</a></li>
            </ul>
        </ul>
    </div>
    <div class="building"><span class="title">Huta metalu</span>
        <div class="miniature" id="Metalworks"></div>
        <ul>
            <li>Poziom: {{entity.metalworks.level}}</li>
            <li>Kondycja: {{entity.metalworks.condition*100}}%</li>
            <li>Koszt budowy: {{entity.metalworks.getMetalCost}}/{{entity.metalworks.getCoalCost}}/{{entity.metalworks.getOilCost}}</li>
            <li>Czas budowy: {{entity.metalworks.getBuildingTime}}
            <ul>
                <li><a href="#building_queue" target-container="#building_queue" data-url="{{ path('district_build', { 'id': entity.id, 'buildingType': 'Metalworks' }) }}">Buduj</a></li>
            </ul>
        </ul>
    </div>
    <div class="building"><span class="title">Rafineria</span>
        <div class="miniature" id="Rafinery"></div>
        <ul>
            <li>Poziom: {{entity.rafinery.level}}</li>
            <li>Kondycja: {{entity.rafinery.condition*100}}%</li>
            <li>Koszt budowy: {{entity.rafinery.getMetalCost}}/{{entity.rafinery.getCoalCost}}/{{entity.rafinery.getOilCost}}</li>
            <li>Czas budowy: {{entity.rafinery.getBuildingTime}}
            <ul>
                <li><a href="#building_queue" target-container="#building_queue" data-url="{{ path('district_build', { 'id': entity.id, 'buildingType': 'Rafinery' }) }}">Buduj</a></li>
            </ul>
        </ul>
    </div>
    <div class="building"><span class="title">Elektorwnia</span>
        <div class="miniature" id="PowerPlant"></div>
        <ul>
            <li>Poziom: {{entity.powerPlant.level}}</li>
            <li>Kondycja: {{entity.powerPlant.condition*100}}%</li>
            <li>Koszt budowy: {{entity.powerPlant.getMetalCost}}/{{entity.powerPlant.getCoalCost}}/{{entity.powerPlant.getOilCost}}</li>
            <li>Czas budowy: {{entity.powerPlant.getBuildingTime}}
            <ul>
                <li><a href="#building_queue" target-container="#building_queue" data-url="{{ path('district_build', { 'id': entity.id, 'buildingType': 'PowerPlant' }) }}">Buduj</a></li>
            </ul>
        </ul>
    </div>
    <div class="building"><span class="title">Magazyn węgla</span>
        <div class="miniature" id="CoalStorage"></div>
        <ul>
            <li>Poziom: {{entity.coalStorage.level}}</li>
            <li>Kondycja: {{entity.coalStorage.condition*100}}%</li>
            <li>Koszt budowy: {{entity.coalStorage.getMetalCost}}/{{entity.coalStorage.getCoalCost}}/{{entity.coalStorage.getOilCost}}</li>
            <li>Czas budowy: {{entity.coalStorage.getBuildingTime}}
            <ul>
                <li><a href="#building_queue" target-container="#building_queue" data-url="{{ path('district_build', { 'id': entity.id, 'buildingType': 'CoalStorage' }) }}">Buduj</a></li>
            </ul>
        </ul>
    </div>
    <div class="building"><span class="title">Magazyn metalu</span>
        <div class="miniature" id="MetalStorage"></div>
        <ul>
            <li>Poziom: {{entity.metalStorage.level}}</li>
            <li>Kondycja: {{entity.metalStorage.condition*100}}%</li>
            <li>Koszt budowy: {{entity.metalStorage.getMetalCost}}/{{entity.metalStorage.getCoalCost}}/{{entity.metalStorage.getOilCost}}</li>
            <li>Czas budowy: {{entity.metalStorage.getBuildingTime}}
            <ul>
                <li><a href="#building_queue" target-container="#building_queue" data-url="{{ path('district_build', { 'id': entity.id, 'buildingType': 'MetalStorage' }) }}">Buduj</a></li>
            </ul>
        </ul>
    </div>
    <div class="building"><span class="title">Zbiornik ropy</span>
        <div class="miniature" id="OilTank"></div>
        <ul>
            <li>Poziom: {{entity.oilTank.level}}</li>
            <li>Kondycja: {{entity.oilTank.condition*100}}%</li>
            <li>Koszt budowy: {{entity.oilTank.getMetalCost}}/{{entity.oilTank.getCoalCost}}/{{entity.oilTank.getOilCost}}</li>
            <li>Czas budowy: {{entity.oilTank.getBuildingTime}}
            <ul>
                <li><a href="#building_queue" target-container="#building_queue" data-url="{{ path('district_build', { 'id': entity.id, 'buildingType': 'OilTank' }) }}">Buduj</a></li>
            </ul>
        </ul>
    </div>
    <div class="building"><span class="title">Giełda</span>
        <div class="miniature" id="Market"></div>
        <ul>
            <li>Poziom: {{entity.market.level}}</li>
            <li>Kondycja: {{entity.market.condition*100}}%</li>
            <li>Koszt budowy: {{entity.market.getMetalCost}}/{{entity.market.getCoalCost}}/{{entity.market.getOilCost}}</li>
            <li>Czas budowy: {{entity.market.getBuildingTime}}
            <ul>
                <li><a href="#building_queue" target-container="#building_queue" data-url="{{ path('district_build', { 'id': entity.id, 'buildingType': 'Market' }) }}">Buduj</a></li>
            </ul>
        </ul>
    </div>
    <div class="building"><span class="title">Centrum dowodzenia</span>
        <div class="miniature" id="Headquaters"></div>
        <ul>
            <li>Poziom: {{entity.headquaters.level}}</li>
            <li>Kondycja: {{entity.headquaters.condition*100}}%</li>
            <li>Koszt budowy: {{entity.headquaters.getMetalCost}}/{{entity.headquaters.getCoalCost}}/{{entity.headquaters.getOilCost}}</li>
            <li>Czas budowy: {{entity.headquaters.getBuildingTime}}
            <ul>
                <li><a href="#building_queue" target-container="#building_queue" data-url="{{ path('district_build', { 'id': entity.id, 'buildingType': 'Headquaters' }) }}">Buduj</a></li>
            </ul>
        </ul>
    </div>
    <div class="building"><span class="title">Lotnisko</span>
        <div class="miniature" id="Airport"></div>
        <ul>
            <li>Poziom: {{entity.airport.level}}</li>
            <li>Kondycja: {{entity.airport.condition*100}}%</li>
            <li>Koszt budowy: {{entity.airport.getMetalCost}}/{{entity.airport.getCoalCost}}/{{entity.airport.getOilCost}}</li>
            <li>Czas budowy: {{entity.airport.getBuildingTime}}
            <ul>
                <li><a href="#building_queue" target-container="#building_queue" data-url="{{ path('district_build', { 'id': entity.id, 'buildingType': 'Airport' }) }}">Buduj</a></li>
            </ul>
        </ul>
    </div>
    <div class="building"><span class="title">Laboratorium</span>
        <div class="miniature" id="Laboratory"></div>
        <ul>
            <li>Poziom: {{entity.laboratory.level}}</li>
            <li>Kondycja: {{entity.laboratory.condition*100}}%</li>
            <li>Koszt budowy: {{entity.laboratory.getMetalCost}}/{{entity.laboratory.getCoalCost}}/{{entity.laboratory.getOilCost}}</li>
            <li>Czas budowy: {{entity.laboratory.getBuildingTime}}
            <ul>
                <li><a href="#building_queue" target-container="#building_queue" data-url="{{ path('district_build', { 'id': entity.id, 'buildingType': 'Laboratory' }) }}">Buduj</a></li>
            </ul>
        </ul>
    </div>
    <div class="building"><span class="title">Struktury obronne</span>
        <div class="miniature" id="DefenceStructures"></div>
        <ul>
            <li>Poziom: {{entity.defenceStructures.level}}</li>
            <li>Kondycja: {{entity.defenceStructures.condition*100}}%</li>
            <li>Koszt budowy: {{entity.defenceStructures.getMetalCost}}/{{entity.defenceStructures.getCoalCost}}/{{entity.defenceStructures.getOilCost}}</li>
            <li>Czas budowy: {{entity.defenceStructures.getBuildingTime}}
            <ul>
                <li><a href="#building_queue" target-container="#building_queue" data-url="{{ path('district_build', { 'id': entity.id, 'buildingType': 'DefenceStructures' }) }}">Buduj</a></li>
            </ul>
        </ul>
    </div>
    <div class="building"><span class="title">Akademia</span>
        <div class="miniature" id="Academy"></div>
        <ul>
            <li>Poziom: {{entity.academy.level}}</li>
            <li>Kondycja: {{entity.academy.condition*100}}%</li>
            <li>Koszt budowy: {{entity.academy.getMetalCost}}/{{entity.academy.getCoalCost}}/{{entity.academy.getOilCost}}</li>
            <li>Czas budowy: {{entity.academy.getBuildingTime}}
            <ul>
                <li><a href="#building_queue" target-container="#building_queue" data-url="{{ path('district_build', { 'id': entity.id, 'buildingType': 'Academy' }) }}">Buduj</a></li>
            </ul>
        </ul>
    </div>
    <div class="building"><span class="title">Garnizon</span>
        <div class="miniature" id="Garnison"></div>
        <ul>
            <li>Poziom: {{entity.garnison.level}}</li>
            <li>Kondycja: {{entity.garnison.condition*100}}%</li>
            <li>Koszt budowy: {{entity.garnison.getMetalCost}}/{{entity.garnison.getCoalCost}}/{{entity.garnison.getOilCost}}</li>
            <li>Czas budowy: {{entity.garnison.getBuildingTime}}
            <ul>
                <li><a href="#building_queue" target-container="#building_queue" data-url="{{ path('district_build', { 'id': entity.id, 'buildingType': 'Garnison' }) }}">Buduj</a></li>
            </ul>
        </ul>
    </div>
</div>
<div id="building_queue">
    {% render "SpecialOperationsGameBundle:District:getQueue" with {'district': entity.id} %}
</div>

<ul class="record_actions panel">
    <li>
        <a href="#" data-url="{{ path('district') }}" target-container="content">
            Back to the list
        </a>
    </li>
</ul>
{% block queue %}

{% endblock %}
{% endblock %}